﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserGroups.aspx.cs" Inherits="Torch.WL.Web.Admin.Modubles.UserGroups" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户分组管理</title>
    <link href="../../../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/css/indexControl.css"
        rel="stylesheet" type="text/css" />

    <script src="../../../Inc/Script/pub.js" type="text/javascript"></script>

    <link href="../../../resources/css/Framework.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">

        //新增数据合法性检测
        function CheckAdd() {
            var ret = true;

            if ($id("txt_name").value == "") {
                alert('请输入用户组名');
                ret = false;
            }
            else if ($id("txt_order").value == "") {
                alert('请输入排序编号');
                ret = false;
            }
            else if (!IsPlusInt($id("txt_order").value)) {
                alert('排序编号必须为整数');
                ret = false;
            }
            return ret;
        }
        
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="divToolBar" class="topBar">
        <div class="toolBar">
        </div>
        <div class="moduleName">
            用户分组管理</div>
    </div>
    <div class="w_wrapper w_marginTop">
        <div class="w_header">
            <div class="w_inputArea">
                <label>所属上级：</label><asp:DropDownList ID="gtList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="gtList_SelectedIndexChanged">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                名称：
            <asp:TextBox ID="txt_Name" Width="120" MaxLength="30" CssClass="w_text" runat="server"></asp:TextBox>
            说明：
            <asp:TextBox ID="txt_Description" CssClass="w_text" runat="server"></asp:TextBox>
            排序：
            <asp:TextBox ID="txt_order" CssClass="w_text" Width="30px" runat="server" onkeypress="return event.keyCode>=48&&event.keyCode<=57"
                onpaste="return !clipboardData.getData('text').match(/\D/)"></asp:TextBox>
            <asp:Button ID="btn_add" CssClass="w_button" runat="server" Text="新增" OnClick="btn_add_Click" />
            </div>
            <div id="strinfo" runat="server" class="w_info" visible="false">
            </div>
        </div>
        <div class="w_content">
            <asp:GridView ID="GroupsLists" runat="server" DataKeyNames="UG_ID" CssClass="w_table"
                AllowSorting="True" OnRowCommand="GroupsLists_RowCommand" OnRowDataBound="GroupsLists_RowDataBound"
                AllowPaging="True" OnPageIndexChanging="GroupsLists_PageIndexChanging" PageSize="15"
                AutoGenerateColumns="False" OnRowCancelingEdit="GroupsLists_RowCancelingEdit"
                OnRowEditing="GroupsLists_RowEditing" OnRowUpdating="GroupsLists_RowUpdating" GridLines="None">
                <FooterStyle CssClass="GridFooter" />
                <RowStyle CssClass="Row" />
                <Columns>
                    <asp:BoundField HeaderText="分组编号" DataField="UG_ID" ReadOnly="true">
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="70px" />
                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="名称">
                        <ItemTemplate>
                            <asp:Label ID="Lab_name" runat="server" Text='<%# Eval("UG_Name") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_name" Width="120" MaxLength="30" CssClass="w_text" runat="server"
                                Text='<%# Eval("UG_Name") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" Wrap="False" />
                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="说明">
                        <ItemTemplate>
                            <asp:Label ID="Lab_Description" runat="server" Text='<%# Eval("UG_Description")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_Description" Width="120" MaxLength="30" CssClass="w_text" runat="server"
                                Text='<%# Eval("UG_Description") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" Wrap="False" />
                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="排序">
                        <ItemTemplate>
                            <asp:Label ID="lab_order" runat="server" Text='<%# Eval("UG_Order") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_order" Width="30" MaxLength="3" CssClass="w_text" onkeypress="return event.keyCode>=48&&event.keyCode<=57"
                                onpaste="return !clipboardData.getData('text').match(/\D/)" runat="server" Text='<%# Eval("UG_Order") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="btn_Edit" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="编辑" CommandArgument='<%# Eval("UG_ID")%>'></asp:LinkButton>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:LinkButton ID="btn_update" runat="server" CausesValidation="True" CommandName="Update"
                                Text="更新"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="btn_cancel" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="btn_del" runat="server" CausesValidation="False" CommandName="Del"
                                Text="删除" CommandArgument='<%# Eval("UG_ID")%>'></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="header" />
                <AlternatingRowStyle CssClass="w_trEven" />
            </asp:GridView>
            <div id="GridViewMsg" style="padding: 5px;" runat="server">
            </div>
        </div>
    </div>
    </form>
</body>
</html>
